package com.yantong.mapper;

import com.yantong.pojo.*;
import com.yantong.pojo.vo.HeadLineVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.List;
import java.util.Map;

/**
 * 文章咨询
 * @author sujin
 */
public interface HeadLineMapper {

    /**
     * 分页查询文章类型
     * @param params
     * @param rowBounds
     * @return
     */
    List<HeadLineVo> pageHeadLineList(Map<String, Object> params, RowBounds rowBounds);

    /**
     * 分页查询文章类型
     * @param params
     * @param rowBounds
     * @return
     */
    List<HeadLineVo> pageHeadLineList0(ListHeadlineParams params, RowBounds rowBounds);

    Integer pageHeadLineListCount(ListHeadlineParams params);

    Integer pageHeadLineAppListCount(Map<String, Object> params);

    /**
     * App分页查询文章类型
     * @param params
     * @param rowBounds
     * @return
     */
    List<HeadLineVo> pageHeadLineAppList(Map<String, Object> params, RowBounds rowBounds);

    /**
     * 根据id获取文章信息
     * @param id
     * @return
     */
    HeadLineVo getHeadLine(Long id);

    /**
     * 获取文章分类名称
     * @param map
     * @return
     */
    List<HeadlinePosition> getPositionListToMap(Map<String, Object> map);

    /**
     * 新增文章(无图片、跳转类型和链接)
     * @param headLine
     * @return
     */
    int addHeadLine(HeadLine headLine);

    /**
     * 修改文章
     * @param headLine
     * @return
     */
    int updateHeadLine(HeadLine headLine);

    /**
     * 删除文章
     * @param id
     * @return
     */
    int removeHeadLine(Long id);

    /**
     * 获取文章App详情
     * @param id
     * @return
     */
    HeadLineVo getHeadLineDetail(Long id);

    /**
     * 阅读数加1
     * @param redNumber
     * @param id
     * @return
     */
    int addReadNumberById(@Param("redNumber") Integer redNumber, @Param("id") Long id);

    /**
     * 分页查询文章资讯类型
     * @param params
     * @param rowBounds
     * @return
     */
    List<HeadlinePosition> pageHeadLinePositionList(Map<String, Object> params, RowBounds rowBounds);

    int countHeadLinePositionList(Map<String, Object> params);

    Integer pageHeadLinePositionListCount(Map<String, Object> params);

    /**
     * 新增文章分类
     * @param headlinePosition
     * @return
     */
    int addHeadLinePosition(HeadlinePosition headlinePosition);

    /**
     * 获取文章分类详情
     * @param id
     * @return
     */
    HeadlinePosition getHeadLinePosition(Long id);

    /**
     * 修改文章分类
     * @param headlinePosition
     * @return
     */
    int updateHeadLinePosition(HeadlinePosition headlinePosition);

    /**
     * 删除文章分类
     * @param id
     * @return
     */
    int removeHeadLinePosition(Long id);

    int deleteByPrimaryKey(Integer id);

    int insert(HeadLine record);

    int insertSelective(HeadLine record);

    HeadLine selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(HeadLine record);

    int updateByPrimaryKey(HeadLine record);

}
